const request = require('request');
const j = request.jar()
// const uri = 'http://www.kuwo.cn/api/www/artist/artistInfo?category=0&prefix=A&pn=1&rn=102&reqId=8a720c90-9323-11ea-9aa5-51867ddfd857'
const uri = 'https://www.ximalaya.com/revision/category/queryCategoryPageAlbums?category=yinyue&subcategory=&meta=&sort=0&page=1&perPage=30'
module.exports = (req, res) => {
  request(uri, {
    /*'auth': {
      'Cookie': '__guid=112476674.2985929862006420000.1589159132936.168; monitor_count=1; Hm_lvt_cdb524f42f0ce19b169a8071123a4797=1589159134; Hm_lpvt_cdb524f42f0ce19b169a8071123a4797=1589159134; _ga=GA1.2.1798619249.1589159134; _gid=GA1.2.1472048814.1589159134; kw_token=AHPCS3O1LWG',
      'csrf': 'AHPCS3O1LWG'
    }*/
  }, function (error, response, body) {
    // console.error('error:', error); // Print the error if one occurred
    // console.log('response:', response); // Print the response status code if a response was received
    // console.log('body:', body); // Print the HTML for the Google homepage.
    res.status(200).json({
      code: 200,
      msg: 'success',
      data: JSON.parse(body)
    })
  });
}
